<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org" xmlns:sec="https://www.thymeleaf.org/thymeleaf-extras-springsecurity4">
<head>
    <meta charset="UTF-8">
    <title>CommonHeader</title>
</head>
<body>
<div th:fragment="libSysCommonHeader" id="libSysCommonHeader">
    <ul class="layui-nav" lay-filter="">
        <li class="layui-nav-item"><a class="layui-nav-item-logo" href="">图书馆信息管理系统</a></li>
        <li class="layui-nav-item"><a href="/bookList">书籍列表</a></li>
        <li class="layui-nav-item" sec:authorize="hasRole('ROLE_ADMIN')"><a href="/record">借阅记录</a></li>
        <li class="layui-nav-item" sec:authorize="hasRole('ROLE_USER')"><a href="/record">我的借阅</a></li>
        <li class="layui-nav-item" sec:authorize="hasRole('ROLE_ADMIN')"><a href="/manager/userList">用户列表</a></li>
        <li class="layui-nav-item" sec:authorize="isAuthenticated()">
            <form action="/search" method="post">
                    <div class="layui-inline-block">
                        <input class="layui-input" name="searchText" placeholder="输入关键字" style="float:left">
                    </div>
            </form>
        </li>
        <li class="layui-nav-item" sec:authorize="isAuthenticated()" style="float:right">
            <a th:href="@{/logout}"><span>注销</span></a>
        </li>
        <li class="layui-nav-item" sec:authorize="!isAuthenticated()" style="float:right">
            <a href="" th:href="@{/register}">注册</a>
        </li>
        <li class="layui-nav-item" sec:authorize="!isAuthenticated()" style="float:right">
            <a href="" th:href="@{/login}">登陆</a>
        </li>
        <li class="layui-nav-item" sec:authorize="isAuthenticated()" style="float:right">
            <a><span sec:authentication="name"></span></a>
            <dl class="layui-nav-child">
                <dd id="pwdChangeButton"><a>修改密码</a></dd>
                <dd id="userEditButton"><a>修改信息</a></dd>
                <dd id="userInfoButton"><a>我的信息</a></dd>
            </dl>
        </li>
    </ul>
</div>


</body>
</html>